package shapes;

public class RightTriangle extends Triangle {

    public RightTriangle(int height) {

        super(height);
        data = new char[height][2 * height - 1];
    }

    @Override
    public void create() {
        int noOfAsterisks = 1;
        String Asterisk;
        StringUtilities stringUtilities = new StringUtilities();

        for (int i = 0; i < height; i++) {
            Asterisk = stringUtilities.characterRepeat(noOfAsterisks);
            data[i] = stringUtilities.padRight(Asterisk, 2 * height - 1).toCharArray();
            noOfAsterisks += 2;
        }
    }
}
